<template>
  <div>
    <custom-form :form="editForm" :formItems="editFormItems">
      <template v-slot:id></template>

      <template v-slot:old_password="{ form, label }">
        <el-form-item :label="label">
          <el-input
            v-model="form.old_password"
            type="password"
            placeholder
          ></el-input>
        </el-form-item>
      </template>
      <template v-slot:new_password="{ form, label }">
        <el-form-item :label="label">
          <el-input
            v-model="form.new_password"
            type="password"
            placeholder
          ></el-input>
        </el-form-item>
        <el-form-item label>
          <el-button @click="$emit('cancel')">取 消</el-button>
          <el-button type="primary" @click="$emit('edit', editForm)"
            >确 定</el-button
          >
        </el-form-item>
      </template>
    </custom-form>
  </div>
</template>


<script>
import CustomForm from '@/components/CustomForm'
import { modify_passwd } from '@/api/table'

export default {
  props: ['editForm'],
  data() {
    return {
      editFormItems: [
        { label: '主键', prop: 'id' },
        { label: '用户', prop: 'name' },
        { label: '旧密码', prop: 'old_password' },
        { label: '新密码', prop: 'new_password' },
      ],
    }
  },
  computed: {},

  methods: {},

  components: {
    CustomForm,
  },
}
</script>